package edu.jamestang.yeb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import edu.jamestang.yeb.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * @author JamesTang
 * @date 2021/12/22 11:26
 */

@Mapper
public interface EmployeeMapper extends BaseMapper<Employee> {


    /**
     * Get all employee by page
     * @param page page
     * @param employee object
     * @param dateScope scope
     * @return Page
     */
    IPage<Employee> getEmployeeByPage(Page<Employee> page, @Param("employee") Employee employee, @Param("dateScope") LocalDate[] dateScope);

    /**
     * Get Employee
     * @param id Employee id
     * @return Employee List
     */
    List<Employee> getEmployee(Integer id);

    /**
     * get Page
     * @param page page
     * @return page
     */
    IPage<Employee> getEmployeeWithSalary(Page<Employee> page);
}
